<script type="text/javascript">
	document.title = '添加内容';
	self.moveTo(-4, -4);
	function refersh_window() {
		$.cookie('refersh_time', 1);
	}
	$(document).ready(function() {
		//日期选择控件
		Calendar.setup({
			weekNumbers : true,
			inputField : "createtime",
			trigger : "createtime",
			dateFormat : "%Y-%m-%d %H:%M:%S",
			showTime : true,
			minuteStep : 1,
			onSelect : function() {
				this.hide();
			}
		});

		//来源选择
		$("#copyfrom_data").change(function() {
			var copyfrom_data = $(this).val();
			if (copyfrom_data != 0) {
				$("#copyfrom").val(copyfrom_data);
			}
		}),

		KindEditor.ready(function(K) {
			var editor1 = K.create('textarea[name="content"]', {
				uploadJson : '/js/kindeditor/php/upload_json.php',
				fileManagerJson : '/js/kindeditor/php/file_manager_json.php',
				allowFileManager : true,
				afterCreate : function() {
					var self = this;
					K.ctrl(document, 13, function() {
						self.sync();
						K('form[name=myform]')[0].submit();
					});
					K.ctrl(self.edit.doc, 13, function() {
						self.sync();
						K('form[name=myform]')[0].submit();
					});
				}
			});
			prettyPrint();
		});
	})
</script>

<body>
	<form name="myform" id="myform" action="/Content/addContent/" method="post"
		enctype="multipart/form-data">
		<div class="addContent">
			<div class="crumbs">当前位置： 内容管理 &gt; 添加内容</div>
			<div class="col-right">
				<div class="col-1">
					<div class="content pad-6">
						<h6>缩略图</h6>
						<div class='upload-pic img-wrap'>
							<input type='hidden' name='news_img' id='news_img' value=''>
							<a href='javascript:void(0);'
								onclick="upload('content','news_img');return false;">
								<img src='/img/icon/upload-pic.png' id='thumb_preview'
								style='cursor: hand' />
							</a>
						</div>

						<h6>相关文章</h6>
						<input type='hidden' name='relation' id='relation' value=''
							style=''>
						<ul class="list-dot" id="relation_text"></ul>
						<div>
							<input type='button' value="添加相关"
								onclick="window.top.omnipotent('selectid','/Content/relationlist/<?php echo $catid;?>/','添加相关文章',1)"
								class="button" style="width: 66px;"> <span
								class="edit_content"> <input type='button' value="显示已有"
								onclick="show_relation(1,0)" class="button" style="width: 66px;">
							</span>
						</div>

						<h6>发布时间</h6>
						<input type="text" name="createtime" id="createtime"
							value="<?php echo $today;?>" size="21" class="date" readonly>&nbsp;

						<h6>允许评论</h6>
						<label class="ib" style="width: 88px"> <input type="radio"
							name='allow_comment' id="allow_comment_1" checked value="1">允许评论
						</label> <label class="ib" style="width: 88px"> <input
							type="radio" name='allow_comment' id="allow_comment_0" value="0">不允许评论
						</label>

						<h6>是否置顶</h6>
						<label class="ib" style="width: 88px"> <input type="radio"
							name='istop' id="allow_istop_1" value="1">置顶
						</label> <label class="ib" style="width: 88px"> <input
							type="radio" name='istop' id="allow_istop_0" checked value="0">不置顶
						</label>

						<h6>状态</h6>
						<label class="ib" style="width: 88px"> <input type="radio"
							name='status' id="allow_status_1" checked value="1">发布
						</label> <label class="ib" style="width: 88px"> <input
							type="radio" name='status' id="allow_status_0" value="0">不允许发布
						</label>
					</div>
				</div>
			</div>
			<div class="col-auto">

				<div class="col-1">
					<div class="content pad-6">
						<table width="100%" cellspacing="0" class="table_form">
							<tbody>
								<tr>
									<th width="80"><font color="red">*</font> 栏目</th>
									<td><input type="hidden" name="catid"
										value="<?php echo $catid;?>"> <?php echo $Cate_info['Category']['name'];?></td>
								</tr>
								<tr>
									<th width="80"><font color="red">*</font> 标题</th>
									<td><input type="text" style="width: 400px;" name="title"
										id="title" value="" style="color:" class="measure-input "
										onBlur="$.post('/Content/keywords/'+Math.random(), {title:$('#title').val()}, function(data){if(data && $('#keywords').val()=='') $('#keywords').val(data); })"
										onkeyup="strlen_verify(this, 'title_len', 80);" /> <input
										type="hidden" name="style_color" id="style_color" value="">
										<input type="hidden" name="style_font_weight"
										id="style_font_weight" value=""><img
										src="/img/icon/colour.png" title="设置标题颜色" width="15"
										height="16"
										onclick="colorpicker('title_colorpanel','set_title_color');"
										style="cursor: hand" /> <img src="/img/icon/bold.png"
										width="10" height="10" onclick="input_font_bold()"
										style="cursor: hand" title="标题是否加粗" /> <span
										id="title_colorpanel" style="position: absolute;"
										class="colorpanel"></span>还可输入<B><span id="title_len">80</span></B>
										个字符</td>
								</tr>
								<tr>
									<th width="80">关键词</th>
									<td><input type='text' name='keywords' id='keywords'
										value='' style='width: 280px' class='input-text'>
										多关键词之间用空格或者“,”隔开</td>
								</tr>
								<tr>
									<th width="80">来源</th>
									<td><input type='text' id="copyfrom" name='copyfrom'
										value='' style='width: 400px;' class='input-text'> <select
										name='copyfrom_data' id="copyfrom_data">
											<option value="" selected>≡请选择≡</option>
											<?php
											 foreach($copyfrom as $val) {
											   echo "<option value=\"$val\">$val</option>";
 											 }
											?>
									</select></td>
								</tr>
								<tr>
									<th width="80">摘要</th>
									<td><textarea name='description' id='description'
											style='width: 98%; height: 46px;'
											onkeyup="strlen_verify(this, 'description_len', 255)"></textarea>还可输入<B><span
											id="description_len">255</span></B> 个字符</td>

								</tr>
								<tr>
									<th width="80"><font color="red">*</font> 内容</th>
									<td>
										<div id='content_tip'></div> <textarea name="content"
											style="width: 670px; height: 270px; visibility: hidden;"
											id="content"></textarea>
										<div class="content_attr">
											<label><input name="add_introduce" type="checkbox"
												value="1">是否截取内容</label><input type="text"
												name="introcude_length" value="200" size="3">字符至内容摘要
										</div>
									</td>
								</tr>
								<tr>
									<th width="80">分页方式</th>
									<td><select name="pagetype" id="pagetype"
										onchange="if(this.value==1)$('#paginationtype1').css('display','');else $('#paginationtype1').css('display','none');">
											<option value="0">不分页</option>
											<option value="1">自动分页</option>
											<option value="2">手动分页</option>
									</select> <span id="paginationtype1" style="display: none"><input
											name="maxcharperpage" type="text" id="maxcharperpage"
											value="10000" size="8" maxlength="8">字符数（包含HTML标记） </span></td>
								</tr>
							</tbody>
						</table>
					</div>
				</div>
			</div>

		</div>

		<div class="fixed-bottom">
			<div class="fixed-but text-c">
				<div class="button">
					<input value="保存后自动关闭" type="submit" name="dosubmit" class="cu"
						style="width: 145px;" onclick="refersh_window()">
				</div>
				<div class="button">
					<input value="保存并继续发表" type="submit" name="dosubmit_continue"
						class="cu" style="width: 130px;" title="Alt+X"
						onclick="refersh_window()">
				</div>

				<div class="button">
					<input value="关闭(X)" type="button" name="close"
						onclick="refersh_window();close_window();" class="cu"
						style="width: 70px;">
				</div>
			</div>
		</div>
	</form>

</body>
</html>